﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using iTextSharp.text.pdf;

namespace PdfObjectInjection
{
    public class PdfTemplateInject
    {
        /// <summary>
        /// Use this to fill out a pdf form with its field names
        /// </summary>
        /// <param name="currentForm"></param>
        /// <param name="fields"></param>
        public PdfTemplateInject(object currentForm, AcroFields fields)
        {
            var type = currentForm.GetType();
            var properties = type.GetProperties().ToList();
            properties.ForEach(info => fields.SetField(info.Name, info.Name));
        }

    }
}
